package com.handinglian.employee.mapper;

import com.handinglian.employee.dto.DepartmentUserNumDto;
import com.handinglian.employee.entity.Department;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

@Mapper
public interface DepartmentMapper {
    int deleteByPrimaryKey(Integer departmentId);

    int insert(Department record);

    int insertOrUpdate(Department record);

    int insertOrUpdateSelective(Department record);

    int insertSelective(Department record);

    Department selectByPrimaryKey(Integer departmentId);

    int updateByPrimaryKeySelective(Department record);

    int updateByPrimaryKey(Department record);

    int updateBatch(List<Department> list);

    int batchInsert(@Param("list") List<Department> list);

    Department findInvalidOneByDepartmentName(@Param("departmentName") String departmentName);

    List<Department> find();

    List<Department> findByDepartmentLevel(@Param("departmentLevel") Integer departmentLevel);

    int updateOrderNoByDepartmentId(@Param("updatedOrderNo") Integer updatedOrderNo, @Param("departmentId") Integer departmentId);

    List<DepartmentUserNumDto> inquireDepartmentUserNum();

    List<Department> findByParentIdIn(@Param("parentIdCollection") Collection<Integer> parentIdCollection);

    List<Department> findByDepartmentNameIn(@Param("departmentNameCollection")Collection<String> departmentNameCollection);

}